<?php

namespace Drupal\shushengyuan\Schemas;

use Drupal\shusy_hotel\Entity\ShusyHotel;

class HotelItem extends AbstractBaseModel {

  protected function getEntityType() {
    return 'shusy_hotel';
  }

  protected function setValue() {
    if ($this->entity instanceof ShusyHotel) {
      $value = [
        'id' => (int) $this->entity->id,
        'name' => (string) $this->entity->name,
        'address' => (string) $this->entity->address,
        'longitude' => (string) $this->entity->longitude,
        'latitude' => (string) $this->entity->latitude,
        'store' => StoreItem::init($this->entity->store_id),
        'imgs' => $this->getImgs($this->wrapper->field_images),
      ];
      $this->merge($value);
    }
  }

}
